}
wpt->SetCreationTime(basetime +
- ((data->hour & 0x1F) * 3600) + (data->min * 60) + data->sec);
- if (data->dsec) {
- wpt->microseconds = (int)data->dsec * 10000;
- }
+ ((data->hour & 0x1F) * 3600) + (data->min * 60) + data->sec, (int)data->dsec * 10000);
return wpt;
}
memset(zbuf, 0, sizeof(zbuf));
memset(ffbuf, 0xFF, sizeof(ffbuf));
- wpt_class = wpt->microseconds; /* trick */
+ wpt_class = wpt->wpt_flags.fmt_use; /* trick */
FWRITE_CSTR(shortname); /* uniqe (!!!) shortname */
FWRITE_i32(wpt_class); /* waypoint class */
/* extra_data may contain a modified shortname */
FWRITE_CSTR((wpt->extra_data) ? (char*)wpt->extra_data : wpt->shortname);
- wpt_class = wpt->microseconds; /* trick */
+ wpt_class = wpt->wpt_flags.fmt_use; /* trick */
FWRITE_i32(wpt_class); /* waypoint class */
FWRITE_CSTR(GMSD_GET(cc, "")); /* country */
if (wpt_class == -1) {
wpt_class = (route_flag) ? GDB_DEF_HIDDEN_CLASS : GDB_DEF_CLASS;
}
- wpt->microseconds = wpt_class; /* trick, we need this for the route(s) */
+ wpt->wpt_flags.fmt_use = wpt_class; /* trick, we need this for the route(s) */
icon = GMSD_GET(icon, -1);
if (icon < 0) {
wpt->longitude = xlon;
WAYPT_SET(wpt, course, le_read16(&buf[16 + 0]));
-
+ int microseconds = 0;
if (ggv_log_ver == 10) {
double secs;
tm.tm_min = le_read16(&buf[16 + 16]);
secs = le_read_double(&buf[16 + 18]);
tm.tm_sec = (int)secs;
- wpt->microseconds = (secs - tm.tm_sec) * 1000000;
+ microseconds = (secs - tm.tm_sec) * 1000000;
} else {
wpt->altitude = le_read16(&buf[16 + 4]);
wpt->sat = (unsigned char)buf[16 + 14];
tm.tm_year -= 1900;
if (tm.tm_mon > 0) {
tm.tm_mon--;
- wpt->SetCreationTime(mkgmtime(&tm));
+ wpt->SetCreationTime(mkgmtime(&tm), microseconds);
}
}
waypt->hdop = ((unsigned char)buffer[0]) * 0.2f;
waypt->sat = buffer[1];
- waypt->microseconds = decode_sbp_usec(buffer + 2);
- waypt->SetCreationTime(decode_sbp_datetime_packed(buffer + 4));
+ waypt->SetCreationTime(decode_sbp_datetime_packed(buffer + 4),
+ decode_sbp_usec(buffer + 2));
decode_sbp_position(buffer + 12, waypt);
WAYPT_SET(waypt, speed, le_read16(buffer + 24) * 0.01f);
WAYPT_SET(waypt, course, le_read16(buffer + 26) * 0.01f);
tm.tm_mon = buffer[2] - 1;
tm.tm_year = be_readu16(buffer) - 1900;
- waypt->SetCreationTime(mkgmtime(&tm));
- waypt->microseconds = (ms % 1000) * 1000;
+ waypt->SetCreationTime(mkgmtime(&tm), (ms % 1000) * 1000);
}
static void
wpt = NULL;
memset(&time, 0, sizeof(time));
+ int microseconds = 0;
while ((c = csv_lineparse(buff, ",", "", column++))) {
int new_what;
case 6:
sscanf(c, "%d:%d:%d.%d", &time.tm_hour, &time.tm_min, &time.tm_sec, &fracsec);
- wpt->microseconds = MILLI_TO_MICRO(fracsec);
+ microseconds = MILLI_TO_MICRO(fracsec);
/* makes sense only for recorded trackpoints */
if (what != STM_TRKPT) {
- wpt->microseconds = 0;
+ microseconds = 0;
}
break;
if (wpt != NULL) {
time.tm_year -= 1900;
time.tm_mon--;
- wpt->SetCreationTime(mkgmtime(&time));
+ wpt->SetCreationTime(mkgmtime(&time), microseconds);
switch (what) {
case STM_WAYPT: